package com.stedu;

import com.stedu.bean.College;
import com.stedu.exception.SteduException;
import com.stedu.mapper.CollegeMapper;
import com.stedu.mapper.StudentMapper;
import com.stedu.mapper.TeacherMapper;
import com.stedu.service.StudentService;
import com.stedu.service.TeacherService;
import com.stedu.service.impl.CollegeServiceImpl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class SelectClassApplicationTests1 {
    @Autowired
    private CollegeMapper collegeMapper;
    @Autowired
    private StudentMapper studentMapper;
    @Autowired
    private CollegeServiceImpl collegeService;
    @Autowired
    private TeacherMapper teacherMapper;
    @Autowired
    private TeacherService teacherService;
    @Autowired
    private StudentService studentService;
    @Test
    public void Test1(){
        College c = new College(null, "机械院", "电气工程");
        System.out.println(collegeMapper.insert(c));
        //collegeMapper.selectAll().stream().forEach(System.out::println);
        //System.out.println(collegeMapper.selectByFaculty("计算机院"));
    }
    @Test
    public void Test2(){
        //studentMapper.selectAll().stream().forEach(System.out::println);
        //studentMapper.selectBySname("").stream().forEach(System.out::println);
        //Student s = new Student(10, "21061820", "郭阳杨", "女", new Date(), "1班", "123456", 1, null);
        //System.out.println(studentMapper.update(s));
    }
    @Test
    public void Test3() throws SteduException {
        College c = new College(4, "护理院", "计科");
        System.out.println(collegeService.update(c));
    }
    @Test
    public void Test4() throws SteduException {
        teacherMapper.selectByTname("").stream().forEach(System.out::println);
    }
    @Test
    public void Test5() throws SteduException {
        //studentService.selectBySname("").stream().forEach(System.out::println);
    }
    @Test
    public void Test6() throws SteduException {
        System.out.println(studentService.selectBySid(1));
    }
    @Test
    public void Test7() throws SteduException {
        //teacherMapper.selectAll().stream().forEach(System.out::println);
        teacherService.selectAll().stream().forEach(System.out::println);
    }

}
